package com.vois.jack.btmgr.devices.WLBleLinkerDevice;

import com.vois.jack.btmgr.devices.WLCommonBleDev.DefaultWLBleDevice;
import com.vois.jack.btmgr.devices.WLCommonBleDev.WLBleCommand;

public class WLBleLinkerDevice extends DefaultWLBleDevice {
    public static final int SESSION_STATUS_TALK_START = 0x01;
    public static final int SESSION_STATUS_TALK_STOP = 0x02;
    public static final int SESSION_STATUS_LISTEN_START = 0x03;
    public static final int SESSION_STATUS_LISTEN_STOP = 0x04;

    @Override
    public String getDeviceModel() {
        return "Ble Linker";
    }

    @Override
    public void onScanStateChanged(int state) {

    }

    @Override
    public void onVerifying() {

    }

    public void notifySessionStatus(int status) {
        byte[] data = new byte[1];
        data[0] = (byte)status;
        sendCommand(WLBleCommand.BLE_CMD_PTT_SESSION_STATUS_IND, data, 1);
    }

    public void notifyBypassContent(String content) {
        if (content != null) {
            byte[] data = content.getBytes();
            if (data.length < 20) {
                sendCommand(WLBleCommand.BLE_CMD_BYPASS_COMMAND, data, data.length);
            }
        }
    }
}
